<!DOCTYPE html>
<html>
    <?php
    $title = $IndexTitle['h_til'];
    $keywords = $IndexTitle['h_kwd'];
    $description = $IndexTitle['h_des'];
    ?>
    <head>
        <?php require('tpl/header.php') ?>
        <!-- start slider -->
        <link href="<?php echo $helper->to('css/slider.css', false) ?>" rel="stylesheet" type="text/css" media="all" />
        <script type="text/javascript" src="<?php echo $helper->to('js/jquery.eislideshow.js', false) ?>"></script>
        <script type="text/javascript">
            $(function () {
                $('#ei-slider').eislideshow({
                    animation: 'center',
                    autoplay: true,
                    slideshow_interval: 3000,
                    titlesFactor: 0
                });
            });
        </script>
    </head>
    <body>
        <?php require('tpl/nav.php') ?>
        <?php require('tpl/slidebar.php') ?>
        <div class="top_bg">
            <div class="wrap">
                <div class="main1">
                    <?php foreach ($IndexProductCate as $value): ?>
                        <div class="image1_of_3">
                            <img src="<?php echo $helper->to($value['c_img']) ?>" style="height:220px;"/>
                            <a href="<?php echo $helper->to($value['c_url']) ?>"><span class="tag"><?php echo $value['c_name'] ?></span></a>
                        </div>
                    <?php endforeach; ?>
                    <div class="clear"></div>
                </div>
            </div>
        </div>
        <!-- start main -->
        <div class="main_bg">
            <div class="wrap">
                <div class="main">
                    <?php foreach ($ProductCate as $cv): ?>
                        <div class="top_main">
                            <h2><?php echo $cv['c_name'] ?></h2>
                            <a href="<?php echo $helper->to($value['c_url']) ?>">show all</a>
                            <div class="clear"></div>
                        </div>
                        <div class="grids_of_3">
                            <?php foreach ($cv['productList'] as $p) : ?>
                                <div class="grid1_of_3">
                                    <?php
                                    if ($p['p_url'] != '') {
                                        $purl = $helper->url($p['p_url'], false);
                                    } else {
                                        $purl = $helper->url($p['id'], false);
                                    }
                                    ?>
                                    <a href="<?php echo $purl; ?>">
                                        <img src="<?php echo $helper->to(explode(',', $p['p_img'])[0]) ?>" alt=""/>
                                        <h3><?php echo $p['p_name']; ?></h3>
                                        <span class="price"><?php echo $p['p_type']; ?></span>
                                    </a>
                                </div>    
                            <?php endforeach; ?>
                            <div class="clear"></div>
                        </div>
                    <?php endforeach; ?>

                    <div class="clear"></div>

                    <!-- start grids_of_2 -->
                    <div class="grids_of_2">
                        <div class="grid1_of_2">

                            <?php foreach ($service as $s): ?>
                                <div class="span1_of_2">
                                    <h2><?php echo $s['i_kwd'] ?></h2>
                                    <p><?php echo $s['i_des'] ?></p>
                                </div>
                            <?php endforeach; ?>
                        </div>

                        <div class="grid1_of_2 bg">
                            <h2>blog news</h2>
                            <?php foreach ($News as $n): ?>
                                <div class="grid_date">
                                    <div class="date1"> 
                                        <h4><?php echo date('Y', strtotime($n['i_time'])) . '<br/>' . date('m-d', strtotime($n['i_time'])); ?></h4>
                                    </div>
                                    <div class="date_text">
                                        <?php
                                        if ($n['i_url'] != '') {
                                            $nurl = $helper->url('news-details/' . $n['i_url'], false);
                                        } else {
                                            $nurl = $helper->url('news-details/' . $n['id'], false);
                                        }
                                        ?>
                                        <h4><a href="<?php echo $nurl; ?>"><?php echo $n['i_name'] ?></a></h4>
                                        <p><?php echo $n['i_des'] ?></p> 
                                    </div>
                                    <div class="clear"></div>
                                </div>
                            <?php endforeach; ?>

                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </div>
        <?php require('tpl/footer.php') ?>
    </body>
</html>